import request from '@/utils/request'

// 查询轮播图列表
export function listBanner (query) {
  return request({
    url: '/system/banner/list',
    method: 'get',
    params: query
  })
}

// 查询轮播图详细
export function getBanner (id) {
  const params = {
    'id': id
  }
  return request({
    url: '/system/banner/getInfo',
    method: 'get',
    params: params
  })
}

// 新增轮播图
export function addBanner (data) {
  return request({
    url: '/system/banner/insert',
    method: 'post',
    data: data
  })
}

// 修改轮播图
export function updateBanner (data) {
  return request({
    url: '/system/banner/update',
    method: 'post',
    data: data
  })
}

// 删除轮播图
export function delBanner (id) {
  const params = {
    'id': id
  }
  return request({
    url: '/system/banner/delete',
    method: 'post',
    params: params
  })
}
// 批量删除轮播图
export function delBatchBanner (ids) {
  const params = {
    'ids': ids
  }
  return request({
    url: '/system/banner/deleteBatch',
    method: 'post',
    params: params
  })
}

// 导入轮播图
export function importData (data) {
  return request({
    url: '/system/banner/importData',
    method: 'post',
    data: data
  })
}
